<template>
  <div class="error-container">
    <div class="error-content">
      <div class="error-image">
        <div class="error-icon">
          <div class="icon-404">404</div>
          <div class="icon-face">
            <div class="eyes">
              <div class="eye"></div>
              <div class="eye"></div>
            </div>
            <div class="mouth"></div>
          </div>
        </div>
      </div>
      <div class="error-info">
        <h1>404</h1>
        <h2>页面不存在</h2>
        <p>抱歉，您访问的页面不存在或已被删除</p>
        <div class="error-actions">
          <el-button type="primary" @click="goHome">
            <el-icon><House /></el-icon>
            返回首页
          </el-button>
          <el-button @click="goBack">
            <el-icon><Back /></el-icon>
            返回上页
          </el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style lang="scss" scoped>
.error-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.error-content {
  background: white;
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  width: 100%;
}

.error-image {
  margin-bottom: 30px;

  .error-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .icon-404 {
    font-size: 72px;
    font-weight: bold;
    color: #6c757d;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  }

  .icon-face {
    width: 80px;
    height: 80px;
    border: 3px solid #6c757d;
    border-radius: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
  }

  .eyes {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
  }

  .eye {
    width: 6px;
    height: 6px;
    background: #6c757d;
    border-radius: 50%;
  }

  .mouth {
    width: 24px;
    height: 12px;
    border: 2px solid #6c757d;
    border-top: none;
    border-radius: 0 0 24px 24px;
    transform: rotate(180deg);
  }
}

.error-info {
  h1 {
    font-size: 72px;
    color: #409EFF;
    margin: 0 0 10px 0;
    font-weight: bold;
  }
  
  h2 {
    font-size: 24px;
    color: #333;
    margin: 0 0 15px 0;
  }
  
  p {
    color: #666;
    font-size: 16px;
    margin: 0 0 30px 0;
    line-height: 1.5;
  }
}

.error-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .error-content {
    padding: 40px 20px;
  }
  
  .error-image img {
    width: 150px;
    height: 150px;
  }
  
  .error-info {
    h1 {
      font-size: 48px;
    }
    
    h2 {
      font-size: 20px;
    }
    
    p {
      font-size: 14px;
    }
  }
  
  .error-actions {
    flex-direction: column;
    align-items: center;
    
    .el-button {
      width: 200px;
    }
  }
}
</style>
